package com.xique.door.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xique.door.bean.domain.SysUser;
import com.xique.door.mapper.SysUserMapper;
import com.xique.door.service.ISysUserService;
import org.springframework.stereotype.Service;

@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
    @Override
    public SysUser getSysUser(Long id ,String name) {
        QueryWrapper<SysUser> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("user_type","00");
        if(name!=null){
            queryWrapper.eq("user_name",name);
            return baseMapper.selectOne(queryWrapper);
        }
        if(id!=null){
            queryWrapper.eq("user_id",id);
            return baseMapper.selectOne(queryWrapper);
        }
          return null;

    }
}
